package com.ruoyi.lvlian.domain;


import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.utils.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@Data
@ToString
@ApiModel(value = "销售物流关联采购物流对象", description = "销售物流关联采购物流对象 lv_warehouse_ref")
public class WarehouseRef {
    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    private String id;

    /**
     * 本企业简称
     */
    @ApiModelProperty(value = "车牌号码")
    @ExcelProperty("本企业简称")
    private String companyShortName;


    @ApiModelProperty(value = "采购入库单号")
    @ExcelProperty("采购入库单号")
    private String inNum;

    @ApiModelProperty(value = "采购合同编号")
    @ExcelProperty("采购合同编号")
    private String buyerContractNum;

    @ApiModelProperty(value = "利废商名称")
    @ExcelProperty("利废商名称")
    private String buyerName;

    @ApiModelProperty(value = "采购物流车牌号")
    @ExcelProperty("采购物流车牌号")
    private String buyerPlateNo;

    @ApiModelProperty(value = "采购物流司机姓名")
    @ExcelProperty("采购物流司机姓名")
    private String buyerDriverName;

    @ApiModelProperty(value = "采购入库日期")
    @ExcelProperty("采购入库日期")
    private String inDate;

    @ApiModelProperty(value = "采购结算金额")
    @ExcelProperty("采购结算金额")
    private Double buyerSettlementAmount;

    @ApiModelProperty(value = "销售出库单号")
    @ExcelProperty("销售出库单号")
    private String outNum;

    @ApiModelProperty(value = "供销合同编号")
    @ExcelProperty("供销合同编号")
    private String sellerContractNum;



    @ApiModelProperty(value = "供应商名称")
    @ExcelProperty("供应商名称")
    private String sellerName;

    @ApiModelProperty(value = "销售物流车牌号")
    @ExcelProperty("销售物流车牌号")
    private String sellerPlateNo;

    @ApiModelProperty(value = "销售物流司机姓名")
    @ExcelProperty("销售物流司机姓名")
    private String sellerDriverName;

    @ApiModelProperty(value = "销售出库日期")
    @ExcelProperty("销售出库日期")
    private String outDate;

    @ApiModelProperty(value = "销售结算金额")
    @ExcelProperty("销售结算金额")
    private Double sellerSettlementAmount;

    @ApiModelProperty(value = "创建人")
    @ExcelProperty("创建人")
    private String createUser;


    @JsonFormat(pattern = "yyyy-MM-dd")
    private String createDate;

    /**
     * 所属公司编码
     */
    @ExcelProperty("所属公司编码")
    private String orgCode;

    /**
     * 本企业
     */
    @ExcelProperty("本企业")
    private String companyName;
    public String getOutDate() {
        if(StringUtils.isEmpty( outDate)){
            return null;
        }
        if (StringUtils.isNotEmpty(outDate) && DateUtils.isValidDateTime(outDate)) {
            outDate = outDate.substring(0, 10);

        }
        if (StringUtils.isNotEmpty(outDate)) {
            outDate = DateUtils.unifyDateFormats(outDate);
        }
        return outDate;
    }


    public String getInDate() {
        if(StringUtils.isEmpty( inDate)){
            return null;
        }
        if (StringUtils.isNotEmpty(inDate) && DateUtils.isValidDateTime(inDate)) {
            inDate = inDate.substring(0, 10);
        }
        if (StringUtils.isNotEmpty(inDate)) {
            inDate = DateUtils.unifyDateFormats(inDate);
        }

        return inDate;
    }

    @ApiModelProperty(value = "采购物流是否有图")
    private Boolean haveImg;

    private String  startTime;
    private String  endTime;

}
